
package com.runa.rccprotocol.flightControl;

import com.rn.smart.command.dto.valve.contro.FeiKongValve;
import com.runa.monitor.comm.entity.CommValve;
import lombok.Data;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 2024/9/6 13:53
 * zhangYB
 */
@Data
public class ValveOpeningControlRequest {

    /**
     * controlOutTemperature：控制阈值，表示回温控制的目标值，整数
     */
    private String openingControlValue;

    private List<ValveControlParameter> terminalValvesBatchControlParameters;


    public static ValveOpeningControlRequest getRequestBody(FeiKongValve feiKongValve, CommValve commValve) {
        ValveControlParameter valveControlParameter = ValveControlParameter.getInstance(feiKongValve, commValve);
        ValveOpeningControlRequest request = new ValveOpeningControlRequest();
        request.setOpeningControlValue(feiKongValve.getValue());
        request.setTerminalValvesBatchControlParameters(new ArrayList<>(Arrays.asList(valveControlParameter)));
        return request;

    }

}
